<template>
	<assess-operation-view v-if="question" :question="question" :dimensionName="dimensionName"></assess-operation-view>
	<view v-else></view>
</template>

<script>
	import AssessOperationView from '../components/assess-operation-view.vue'
	export default {
		components: {
			AssessOperationView
		},
		data() {
			return {
				question: {},
				dimensionName: '',
			}
		},
		onLoad(option) {
			this.dimensionName = option.dimensionName;
			this.questionId = option.questionId;
			// this.question = JSON.parse(option.data);
			this.getQuestion();
		},
		
		methods: {
			getQuestion() {
				this.$http.request({
					url: '/eapi/operator/question',
					method: 'GET',
					params: {
						questionId: this.questionId,
					},
				}).then(res => {
					uni.hideLoading();
					console.log(res);
					if (res.code === '000000') {
						this.question = res.data;
					}
				}).catch(err => {
					uni.hideLoading();
					console.log(err);
				});
			}
		}
	}
</script>

<style lang="scss">
	uni-page-body,#app {height: 100%;background: #F7F7F7;}
</style>
